<?php
$id=$_GET['id'];

include_once($_SERVER['CONTEXT_DOCUMENT_ROOT'].'/public/func.php');
$config = include_once($_SERVER['CONTEXT_DOCUMENT_ROOT'].'/public/config.php');

$time=$_POST['addtime']=date("Y-m-d H:i:s",time());
$res=add($config,'pinglun',$_POST);
if ($res) {
echo '<script>alert("评论成功");window.location.href="new.php?id='.$id.'"</script>';

}else{
  '<script>alert("评论失败");window.location.href="new.php?id=$id"</script>';
};
